<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="modal-dialog ms-modal-dialog" style="width: 550px;">
  <div class="modal-content">

    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
      <h4 class="modal-title">场地资源信息查询</h4>
    </div>

    <form method="GET" action="${ctx.host}/supplier-reports" class="form-horizontal ms-form modal-search-form" data-validate="true">
      
      <input type="hidden" name="staff" value="true" >
      
      <div class="modal-body">
      
        <div class="form-group ms-form-group">
          <label class="col-xs-4 control-label">默认分区：</label>
          <div class="col-xs-7">
            <select class="select2 form-control" name="branchId" tabindex="1">
              <option ></option>
              <c:forEach var="branch" items="${selection.branch}">
                <option value="${branch.id}">${branch.name}</option>
              </c:forEach>
            </select>
          </div>
        </div>
        
        <div class="form-group ms-form-group">
          <label class="col-xs-4 control-label">供方代码：</label>
          <div class="col-xs-7">
            <input type="text" name="code" class="form-control" placeholder="供方代码">
          </div>
        </div>

        <div class="form-group ms-form-group">
          <label class="col-xs-4 control-label">供方简称：</label>
          <div class="col-xs-7">
            <input type="text" name="shortName" class="form-control" placeholder="供方简称">
          </div>
        </div>
      
        <div class="form-group ms-form-group">
          <label class="col-xs-4 control-label">审核状态：</label>
          <div class="col-xs-7">
            <select name="status" multiple class="select2 form-control">
              <option></option>
              <c:forEach var="status" items="${enums['SupplierAuditStatus']}">
                <option value="${status.ordinal}">${status.description}</option>
              </c:forEach>
            </select>
          </div>
        </div>    
          
        <div class="form-group ms-form-group">  
          <label class="col-xs-4 control-label">供方类型：</label>
          <div class="col-xs-7">
            <select name="type" class="select2 form-control">
              <option></option>
              <c:forEach var="type" items="${enums['SupplierType']}">
                <option value="${type.ordinal}">${type.description}</option>
              </c:forEach>
            </select>
          </div>
        </div>
        
        <div class="form-group ms-form-group">
          <label class="col-xs-4 control-label">供方级别：</label>
          <div class="col-xs-7">
            <select name="level" class="select2 form-control">
              <option></option>
              <c:forEach var="level" items="${enums['SupplierLevel']}">
                <option value="${level.ordinal}">${level.description}</option>
              </c:forEach>
            </select>
          </div>
        </div>
      </div>

      <div class="modal-footer ms-modal-footer">
        <button type="submit" class="btn ms-btn btn-primary">查询</button>
        <button type="button" class="btn ms-btn ms-btn-gary" data-dismiss="modal">取消</button>
      </div>

    </form>
      
  </div>
</div>  

<script type="text/javascript">
  $(document).ready(function(){
    
    $('select[name="branchId"]').select2({
      theme: "classic",
      placeholder: '请选择',
      minimumResultsForSearch: -1,
      allowClear: true,
    });
    
    $('select[name="status"]').select2({
      theme: "classic",
      placeholder : '请选择',
      minimumResultsForSearch : -1,
      allowClear : true,
    });
    
    $('select[name="type"]').select2({
      theme: "classic",
      placeholder : '请选择',
      minimumResultsForSearch : -1,
      allowClear : true,
    });
    
    $('select[name="level"]').select2({
      theme: "classic",
      placeholder : '请选择',
      minimumResultsForSearch : -1,
      allowClear : true,
    });
    
  });
</script>